<template>
    <div>
      <el-menu
        :default-active="this.$route.path"
        class="el-menu-vertical-demo"
        @open="handleOpen"
        @close="handleClose"
        router=true>
        <el-submenu index="1">
          <template slot="title">
            <i class="el-icon-setting"></i>
            <span>用户权限</span>
          </template>
          <el-menu-item-group>
            <template slot="title">用户</template>
            <el-menu-item index="/main/usertable">用户列表</el-menu-item>
            <el-menu-item index="/main/roletable">角色列表</el-menu-item>
          </el-menu-item-group>
          <el-menu-item-group title="权限">
            <el-menu-item index="/main/authtable">权限列表</el-menu-item>
            <el-menu-item index="/main/roleauthtable">角色授权</el-menu-item>
          </el-menu-item-group>
        </el-submenu>
        <el-menu-item index="/main/posttable">
          <i class="el-icon-menu"></i>
          <span slot="title" >文章管理</span>
        </el-menu-item>
      </el-menu>
    </div>
</template>

<script>
export default {
  name: 'aside',
  methods: {
    handleOpen (key, keyPath) {
      console.log(key, keyPath)
    },
    handleClose (key, keyPath) {
      console.log(key, keyPath)
    }
  }
}
</script>

<style scoped>

</style>
